<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Currency;
use App\Models\User;
use Illuminate\Http\Request;
use OSS\OssClient;
use Silber\Bouncer\Bouncer;
use Silber\Bouncer\BouncerFacade;

class IndexController extends Controller
{
    public function __construct()
    {
        view()->share('menu', 'index');
    }
    /**
     * 后台首页
     * @param  Request $request [description]
     * @return [type]           [description]
     */
    public function index(Request $request)
    {

        //$str = 'd852b29a07db2dc527d585b3051a1c85d9310d647b0b8b02c3fb180833220215';
        //dump(bin2hex($str));
        $oss = new OssClient(config('alioss.accessKeyId'), config('alioss.accessKeySecret'), config('alioss.endpoint'));
        //dump($oss);
        //find in database
        //会员人数
        $user_count = (new User())->where(['status'=>1])->count();
        //人民币收入
        //充值单数
        //币种统计
        $currency_count = (new Currency())->count();
        return view('admin/index/index');
    }
}
